Qris Generate
Generate QRIS MPM
Service ini digunakan untuk membuat QRIS dengan metode Merchant Presented Mode (MPM).
Jenis QRIS
Pada Sistem kami terdapat 2 jenis QRIS yang kami sediakan yaitu QRIS Dinamis dan QRIS Statis:
QRIS Dinamis
Dokumen ini bertujuan untuk menjelaskan spesifikasi API dari pengembangan QRIS Dinamis - MPM dengan skema merchant mengeluarkan QRIS. Kemudian dari SpeedCash mengiriman notifikasi / callback sesuai dengan spesifikasi yang telah ditentukan.
QRIS Statis
API QRIS Statis digunakan untuk membuat kode QR yang dapat digunakan tanpa batas waktu sehingga cukup sekali cetak kode QR akan dapat digunakan terus menerus. QRIS statis sangat cocok digunakan untuk penggiat bisnis yang menginginkan pembayaran cashless tanpa harus repot menyediakan alat untuk generate kode QR setiap ada transaksi.
Jika ingin membuat QR secara dinamis maka wajib mengirimkan amount
pada request body namun jika ingin membuat QR secara statis tidak perlu mengirim amount
pada request body
Service Info
HTTP Method | POST |
---|---|
Service Code | 47 |
Http Method | POST |
Path | .../v1.0/qr/qr-mpm-generate |
Authentication | OAuth 2.0 |
Header
Header Name | Tipe Data | Wajib | Deskripsi |
---|---|---|---|
Content-Type | String | Y | application/json |
X-TIMESTAMP | String | Y | Waktu lokal klien saat ini yyyy-MM-ddTHH:mm:ss.SSSTZD format |
X-PARTNER-ID | String | Y | Client’s client_id (diberikan pada saat onboarding ) |
X-CHANNEL-ID | String | Y | ID channel merchant |
X-SIGNATURE | String | Y | Dibuat dengan algoritma asymmetric with token : Signature Generation |
X-EXTERNAL-ID | String | Y | ID external merchant (tidak boleh sama di hari yang sama) |
Body
Parameter | Tipe Data | Wajib | Deskripsi |
---|---|---|---|
terminalId | String | N | ID terminal Length: 3-16 Allowed Chars: a-z A-Z 0-9 - _ |
partnerReferenceNo | String | N | Unik Id milik Partner Length: 1-25 Allowed Chars: a-z A-Z 0-9 |
amount | Object | C | Objek amount (Wajib jika ingin membuat QR Dinamis) |
value | String | Y | Nilai transaksi Length: 1-14 Allowed Chars: numeric |
feeAmount | Object | N | Objek feeAmount (Tidak semua issuer support tips) |
value | Object | N | Nilai transaksi Length: 1-14 Allowed Chars: numeric |
currency | String | Y | Kode mata uang Length: 3 Allowed Value: IDR |
merchantId | String | Y | ID unik yang dimiliki oleh setiap merchant |
validityPeriod | String | N | Waktu Expired QRIS (yyyy-MM-ddTHH:mm:ss.SSSTZD format ), default 3 hari |
description | String | N | Deskripsi QRIS |
additionalInfo | Object | N | Informasi tambahan. |
feeType | Object | N | tipe fee 1 - free amount of fee 2 - fix amount 3 - fix percentage tidak semua issuer support tips |
- JSON
- CURL
- PHP
- NODE JS
- GO
{
"terminalId": "A01",
"partnerReferenceNo" : "5182732152",
"amount": {
"value": "9000.00",
"currency": "IDR"
},
"feeAmount": {
"value": "1000.00",
"currency": "IDR"
},
"merchantId": "121xxxx",
"validityPeriod" : "2024-10-25T14:49:25+07:00",
"description" : "pembayaran jam tangan rolex",
"additionalInfo" : {
"feeType" : "2",
}
curl --location --request POST '../v1.0/qr/qr-mpm-generate' \
--header 'x-client-key: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc' \
--header 'x-timestamp: 2024-01-16T10:54:21+07:00' \
--header 'x-signature: SLzoCEi+vO0lQ7LfO1m/zQ2htg3C+yqA0g7C858477rYBoTNWnxdk4JqXKARCkFELN57Rhff9wVV888w2uHueA==' \
--header 'x-partner-id: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc' \
--header 'channel-id: 23412' \
--header 'x-external-id: 2024-05-15T01:49:22.694Z' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 6430fe8b-79d5-4e58-a337-6eb498e117a5' \
--data-raw '{
"terminalId": "A01",
"partnerReferenceNo" : "5182732152",
"amount": {
"value": "9000.00",
"currency": "IDR"
},
"feeAmount": {
"value": "1000.00",
"currency": "IDR"
},
"merchantId": "121xxxx",
"validityPeriod" : "2024-10-25T14:49:25+07:00",
"description" : "pembayaran jam tangan rolex",
"additionalInfo" : {
"feeType" : "2",
}
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '../v1.0/qr/qr-mpm-generate',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"terminalId": "A01",
"partnerReferenceNo" : "5182732152",
"amount": {
"value": "9000.00",
"currency": "IDR"
},
"feeAmount": {
"value": "1000.00",
"currency": "IDR"
},
"merchantId": "121xxxx",
"validityPeriod" : "2024-10-25T14:49:25+07:00",
"description" : "pembayaran jam tangan rolex",
"additionalInfo" : {
"feeType" : "2",
}
}',
CURLOPT_HTTPHEADER => array(
'x-client-key: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'x-timestamp: 2024-01-16T10:54:21+07:00',
'x-signature: SLzoCEi+vO0lQ7LfO1m/zQ2htg3C+yqA0g7C858477rYBoTNWnxdk4JqXKARCkFELN57Rhff9wVV888w2uHueA==',
'x-partner-id: 6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'channel-id: 23412',
'x-external-id: 2024-05-15T01:41:13.420Z',
'Content-Type: application/json',
'Authorization: Bearer 6430fe8b-79d5-4e58-a337-6eb498e117a5'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': '../v1.0/qr/qr-mpm-generate',
'headers': {
'x-client-key': '6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'x-timestamp': '2024-01-16T10:54:21+07:00',
'x-signature': 'SLzoCEi+vO0lQ7LfO1m/zQ2htg3C+yqA0g7C858477rYBoTNWnxdk4JqXKARCkFELN57Rhff9wVV888w2uHueA==',
'x-partner-id': '6c57db4e-9e11-4951-9bcf-d6f177dafbcc',
'channel-id': ' 23412',
'x-external-id': '2024-05-15T01:54:52.946Z',
'Content-Type': ' application/json',
'Authorization': 'Bearer 6430fe8b-79d5-4e58-a337-6eb498e117a5'
},
body: '{\n "terminalId": "A01",\n "partnerReferenceNo":"5182732152", \n "amount": {\n "value": "9000.00",\n "currency": "IDR"\n },\n "feeAmount": {\n "value": "1000.00",\n "currency": "IDR"\n },\n "merchantId": "121xxxx",\n "validityPeriod" : "2024-10-25T14:49:25+07:00", \n "description" : "pembayaran jam tangan rolex", \n "additionalInfo": {\n "feeType": "2"\n}'
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "../v1.0/qr/qr-mpm-generate"
method := "POST"
payload := strings.NewReader(`{
"terminalId": "A01",
"partnerReferenceNo" : "5182732152",
"amount": {
"value": "9000.00",
"currency": "IDR"
},
"feeAmount": {
"value": "1000.00",
"currency": "IDR"
},
"merchantId": "121xxxx",
"validityPeriod" : "2024-10-25T14:49:25+07:00",
"description" : "pembayaran jam tangan rolex",
"additionalInfo" : {
"feeType" : "2",
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("x-client-key", "6c57db4e-9e11-4951-9bcf-d6f177dafbcc")
req.Header.Add("x-timestamp", "2024-01-16T10:54:21+07:00")
req.Header.Add("x-signature", "SLzoCEi+vO0lQ7LfO1m/zQ2htg3C+yqA0g7C858477rYBoTNWnxdk4JqXKARCkFELN57Rhff9wVV888w2uHueA==")
req.Header.Add("x-partner-id", "6c57db4e-9e11-4951-9bcf-d6f177dafbcc")
req.Header.Add("channel-id", " 23412")
req.Header.Add("x-external-id", "2024-05-15T01:55:53.630Z")
req.Header.Add("Content-Type", " application/json")
req.Header.Add("Authorization", "Bearer 6430fe8b-79d5-4e58-a337-6eb498e117a5")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Response
Parameter | Tipe Data | Deskripsi |
---|---|---|
responseCode | String | Kode response |
responseMessage | String | Pesan response |
partnerReferenceNo | String | Unik Id milik Partner |
qrContent | String | QR Payload |
qrUrl | String | QR Image Url |
additionalInfo | Object | Informasi tambahan. |
qrId | String | Kode unik QRIS |
{
"responseCode": "2004700",
"responseMessage": "Successful",
"partnerReferenceNo": "5182732152",
"qrContent": "00020101021226760024ID.CO.SPEEDCASH.MERCHANT01189360081530340001920215ID10230000019220303UKE51440014ID.CO.QRIS.WWW0215ID10230000019320303UKE5204581253033605405154005802ID5916SETIA KAWAN SHOP6007BANDUNG6105402656234011051827321520509D100997860703A015502016304C986",
"qrUrl": "../show-qr?qr_id=337&merchant_id=121xxxx"
"additionalInfo": {
"qrId": "10099786"
}
}
List Response Code
Response Code | Response Message | Description |
---|---|---|
2004700 | Success | |
4004701 | Invalid field format { field name } | |
4014700 | Unauthorized. Invalid Signature | X-Signature salah |
4094700 | Cannot use same X-EXTERNAL-ID in same day | X-External-ID sudah pernah digunakan di hari yang sama |
4044701 | Bad Request | Request header ada yang salah / kurang |
4044700 | Unauthorized. Client Forbidden Access API | Partner tidak dapat mengakses api terkait |
4034719 | Merchant Blacklisted | Merchant telah di blacklist |
4044708 | Invalid Merchant | MerchantId tidak valid |
5004701 | Internal Server Error | Terjadi kesalahan di sistem internal |